﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using System.Data.SqlClient;

// NOTE: You can use the "Rename" command on the "Refactor" menu to change the class name "CheckExistUser" in code, svc and config file together.
public class CheckExistUser : ICheckExistUser
{
    public Boolean CheckExist(String user)
	{
        try
        {
            DataClassesDataContext db = new DataClassesDataContext();
            var ut = db.User_Tables.Where(q => (q.Username.Equals(user)));
            if (ut.ToList().Count > 0)
            {
                return true;
            }
            else
                return false;
        }
        catch (Exception ex)
        {
            return false;
        }
	}
}
